<script setup lang="ts">
import { ref } from 'vue';

const eventSource = new EventSource('http://localhost:3000/sse');
const msg = ref<{ message: string, time: string }>();
eventSource.onmessage = (event) => {
  msg.value = JSON.parse(event.data);
};
</script>

<template>
  <div>
    msg:{{ msg?.message }}
    time: {{ msg?.time }}
  </div>

</template>

<style scoped></style>
